@import "var.less";
menu.oc-menu {
	position: relative;
	font-size: 0.6rem;
	font-family: "Microsoft Yahei";
	list-style: none;
	height: @menuHeight;

	ul{
		z-index: 10;
	}
	// 菜单被操作时才允许所有li的悬停动作
	&.focus li:hover > ul {
		display: block;
	}
	&:before {
		content: "";
		display: none;
		position: fixed;
		width: 100%;
		height: 100%;
		z-index: 0;
	}
	&.focus:before {
		display: block;
	}

	li {
		position: relative;
	}
	// Menu的按钮
	> li{
		cursor: default;
		float: left;
		height: @menuHeight;
		line-height: @menuHeight - 0.1rem;
		border: none;
		padding:0 @menuBlank;
		&:hover {
			background-color: @menuLifrontColor;
		}

		// 所有菜单
		ul {
			display: none;
			position: absolute;
			border: 1px solid @listBorderColor;
			top:0;
			left: 100%;
			padding: 2px;
			background: @listColor;
			box-shadow: 4px 4px 2px -2px #878787;
			li {
				list-style: none;
				padding: 1px @itemIconWidth;
				box-sizing: border-box;
				position: relative;
				height: @itemHeight;
				min-width: 4em;
				border:  1px solid transparent;

				// Item Buffer When hover
				&:hover:after{
					content: "";
					display: block;
					position: absolute;
					left: 0;
					height: 0.4rem;
					top:100%;
					width: 100%;
					z-index: 2;
				}
				// Sub icon
				&.sub:before {
					content: "";
					position: absolute;
					display: block;
					width: 0;
					height: 0;
					border: 0.2rem solid;
					border-color: transparent transparent transparent #000;
					top: 0.3rem;
					right: 0.2rem;
				}

				// Item was wraped by button
				a {
					font: inherit;
					text-align: left;
					border: none;
					background: transparent;
					white-space: nowrap; // 为了让按钮里的文本不换行
					cursor: default; // button默认为手型指针
					&::-moz-focus-inner {
						padding:0;
						border:0
					}
					&:after {
						content: "";
						position: absolute;
						top:0;
						left: 0;
						right: 0;
						bottom: 0;
					}
				}
				// Offset when sub ul dispeared.
				> ul{
					margin-top: -2px;
					margin-left: -2px;
				}
			}
			li:hover {
				background: @itemHoverBackgroundColor;
				z-index: 1;
			}
		}
		// 菜单缓冲区
		ul:before {
			content: "";
			background: @bufferColor;
			position: absolute;
			top: 0;
			left: -@reverseBuffer;
			right: -@positiveBuffer;
			bottom: -@positiveBuffer;
		}
		// 第一层菜单的特殊处理
		> ul {
			top: 100%;
			left: 0;
		}
	}
	hr{
		position: relative;
		z-index: -1;
		height:1px;
		border-width:0;
		background-color: rgb(215, 215, 215);//hr的颜色，这里颜色比较浅，和一般的hr不一样，特此没有新建变量存放该颜色
		margin-left: 1.4rem;
		margin-top: 0.1rem;
		margin-bottom: 0.1rem;
	}
}

@keyframes fadeIn {
	from {
		opacity: 0.3;
	}
	to {
		opacity: 1;
	}
}
.sub:hover > ul {
	display: block;
	animation: fadeIn 0.3s;
}
